package cn.littlehx.myweb.config;

import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

//定义的配置类,用来写mybatis plus的配置
@Configuration
public class MPConfig {
    //    定义一个拦截器
    @Bean
    public MybatisPlusInterceptor mybatisPlusInterceptor(){
        MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
        //实现分页的拦截器
        interceptor.addInnerInterceptor(new PaginationInnerInterceptor());
//        可加其他不同的拦截器
        return interceptor;
    }
}
